﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace LibraryManager
{
    public partial class LapTheDocGia : Form
    {
        private string SHID = "";

        public LapTheDocGia(string ID)
        {
            SHID = ID;
            InitializeComponent();
        }

        private void LapTheDocGia_Load(object sender, EventArgs e)
        {
            LoaiDocGia.Items.Add("A");
            LoaiDocGia.Items.Add("B");
            LoaiDocGia.Items.Add("C");
            MaNguoiLapThe.Text = SHID;
        }

        private void Submit_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Tiếp nhận nhân viên với những thông tin đã nhập ?", "Xác nhận", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                LapTheDocGiaDTO dg = new LapTheDocGiaDTO();

                dg.Madocgia = MaDocGia.Text;
                dg.Hovaten = HoVaTen.Text;
                dg.Loaidocgia = LoaiDocGia.Text;
                dg.Ngaysinh = NgaySinh.Text;
                dg.Diachi = DiaChi.Text;
                dg.Email = Email.Text;
                dg.Ngaylapthe = NgayLapThe.Text;
                dg.Nguoilapthe = MaNguoiLapThe.Text;
                dg.Username = Username.Text;
                dg.Password = Password.Text;

                LapTheDocGiaBUS.LapTheDocGia(dg);
            }
        }

        private void Exit_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
